<extend name="./Application/Admin/View/base.html" />
<block name="title"><title><?php echo C(APP_NAME);?>PC端管理</title></block>
<block name="stylesheets">
<link rel="stylesheet" href="__PUBLIC__/assets/css/jquery-ui.css" />
</block>
<block name="stylecss">
<style type='text/css'>
	.pages a,.pages span {
	    display:inline-block;
	    padding:5px 9px;
	    margin:0 1px;
	    border:1px solid #f0f0f0;
	}
	.pages a,.pages li {
	    display:inline-block;
	    list-style: none;
	    text-decoration:none; color:#58A0D3;
	}
	.pages a.first,.pages a.prev,.pages a.next,.pages a.end{
	    margin:0;
	}
	.pages a:hover{
	    border-color:#50A8E6;
	}
	.pages span.current{
	    background:#50A8E6;
	    color:#FFF;
	    font-weight:700;
	    border-color:#50A8E6;
	}
	.table input,select{
		border-radius:6px !important;
	}
</style>
</block>
<block name="smallmenu">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="{:U('Index/index')}">主页</a>
	</li>

	<li class="active">考官列表</li>
</ul><!-- /.breadcrumb -->

<!-- #section:basics/content.searchbox -->
<div class="nav-search" id="nav-search"><button class="btn btn-xs btn-pink" onClick='location.href="__CONTROLLER__/examiner_add"'>添加考官</button></div>
<!-- /.nav-search -->
</block>

<block name="content">
	<div class="accordion" id="accordion2" style="border:1px solid #cccccc;padding:10px;border-radius:8px;margin-bottom:10px">
		<div class="accordion-group">
			<div class="accordion-heading">
				<a class="accordion-toggle collapsed" style="font-size:14px;" data-toggle="collapse" data-parent="#accordion2" href="#collapseSelect"> 请选择查询条件 </a>
			</div>
				<div id="collapseSelect" class="accordion-body collapse" style="height: 0px;padding-top:10px">
					<div class="accordion-inner">
						<form action="" id="form" name="selectUserForm" method="get">
							<input type="hidden" name="p" value="1">
							<table class="table" style="margin:0">
								<tr>
									<td>Midi ID： <input name="user_id" type="text" /></td>
									<td>昵称： <input name="user_nickname" type="text" /></td>
									<td>手机号码： <input name="user_phone" type="text" /></td>
									<td></td>
								</tr>
								<tr>
									<td>电吉他考官：<input name="user_examiner_guitar" type="checkbox" value="1" /></td>
									<td>爵士鼓考官：<input name="user_examiner_drum" type="checkbox" value="1" /></td>
									<td>电贝司考官：<input name="user_examiner_bass" type="checkbox" value="1" /></td>
									<td><button class="btn btn-sm btn-success" type="submit">查询</button></td>
								</tr>
							</table>
							
						</form>
					</div>
				</div>
		</div>
	</div>

	<input type="hidden" id="crontab-s" />

	<table id="sample-table-1" class="table table-striped table-bordered table-hover">
		<thead>
			<tr>
			    <th class="center">Midi ID</th>
				<th class="center">姓名</th>
				<th class="center">手机号码</th>
				<th class="center">电吉他考官</th>
				<th class="center">爵士鼓考官</th>
				<th class="center">电贝司考官</th>
				<th class="center">监考收入比例</th>
				<!-- <th class="center"><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>注册时间</th> -->
				<th class="center">操作</th>
			</tr>
		</thead>

		<tbody>
			<foreach name="user_arr" item="v">
			<tr style="text-align:center">
				<td class="center">{$v.user_id|formatNO=6}</td>
				<td>{$v.user_name}</td>
				<td>{$v.user_phone}</td>
				<td>
					<?php if ($v['user_examiner_guitar'] == 1): ?>
						<span style="color:green">是</span>
					<?php else: ?>
						<span style="color:red">否</span>
					<?php endif ?>
				</td>
				<td>
					<?php if ($v['user_examiner_drum'] == 1): ?>
						<span style="color:green">是</span>
					<?php else: ?>
						<span style="color:red">否</span>
					<?php endif ?>
				</td>
				<td>
					<?php if ($v['user_examiner_bass'] == 1): ?>
						<span style="color:green">是</span>
					<?php else: ?>
						<span style="color:red">否</span>
					<?php endif ?>
				</td>
				<td><span style="color:blue">{$v.user_income_proportion}</span></td>
				<!-- <td>{$v.user_reg_date}</td> -->
				<td>
					<div class="hidden-sm hidden-xs btn-group">
						<div class="hidden-sm hidden-xs action-buttons">

							<a class="blue" style='cursor:pointer' title='查看考生信息'onClick='location.href="__CONTROLLER__/examiner_details/user_id/{$v.user_id}"'>
								<i class="ace-icon fa fa-search-plus bigger-130"></i>
							</a>

							<a class="green" style='cursor:pointer' onClick='location.href="__CONTROLLER__/examiner_edit/user_id/{$v.user_id}"' title='修改考生信息'>
								<i class="ace-icon fa fa-pencil bigger-130"></i>
							</a>

							<a class="red" style='cursor:pointer' onClick='dialog_see({$v.user_id})' title='删除考生'>
								<i class="ace-icon fa fa-trash-o bigger-130"></i>
							</a>
						</div>
					</div>
				</td>
			</tr>
		    </foreach>
		</tbody>
	</table>
<div class="pages" style="float:right">{$page}</div>
<!-- 删除大师模态框（Modal） -->
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static">
   <div class="modal-dialog modal-sm">
	  <div class="modal-content">
		 <div class="modal-header">
			<button type="button" class="close" aria-hidden="true" onClick='modal_close()'>×</button>
			<h4 class="modal-title" id="myModalLabel">删除考官</h4>
		 </div>
		 <div class="modal-body" style='padding-bottom:0px'>
            <div class="row" style='margin-bottom:15px;margin-left:2px;font-size:14px'>
                确认是否删除该考官？
            </div>
		 </div>
		 <div class="modal-footer">
		 	<button data-bb-handler="button" type="button" class="btn btn-sm" onClick='modal_close()'>取消</button>
		 	<button type="button" class="btn btn-sm btn-primary" onClick='type_submit()'>确定</button>
		 </div>
	  </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</block>
<block name="scripts"></block>
<block name="jscript">
<script script="text/javascript">
    $(function(){
        $('#menu_user').addClass('active open');
        $('#menu_examiner_list').addClass('active');
    });
</script>
<script script="text/javascript">
    //模态框查看信息
    function dialog_see(obj) {
    	$('#crontab-s').val(obj);
		$('#myModal').modal('show');
	}

	//模态框关闭
	function modal_close() {
		$('#myModal').modal('hide');
	}

	//删除分类
    function type_delete(obj) {
    	$('#myModal').modal('show');
    }

    //删除提交
    function type_submit() {
    	var crontab = $('#crontab-s').val();
    	$('#myModal').modal('hide');
    	location.href="__CONTROLLER__/examiner_del/user_id/"+crontab;
    }
</script>
<script type="text/javascript">
			jQuery(function($) {
				var oTable1 = 
				$('#sample-table-2')
				//.wrap("<div class='dataTables_borderWrap' />")   //if you are applying horizontal scrolling (sScrollX)
				.dataTable( {
					bAutoWidth: false,
					"aoColumns": [
					  { "bSortable": false },
					  null, null,null, null, null,
					  { "bSortable": false }
					],
					"aaSorting": [],
			
					//,
					//"sScrollY": "200px",
					//"bPaginate": false,
			
					//"sScrollX": "100%",
					//"sScrollXInner": "120%",
					//"bScrollCollapse": true,
					//Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered"
					//you may want to wrap the table inside a "div.dataTables_borderWrap" element
			
					//"iDisplayLength": 50
			    } );
				/**
				var tableTools = new $.fn.dataTable.TableTools( oTable1, {
					"sSwfPath": "../../copy_csv_xls_pdf.swf",
			        "buttons": [
			            "copy",
			            "csv",
			            "xls",
						"pdf",
			            "print"
			        ]
			    } );
			    $( tableTools.fnContainer() ).insertBefore('#sample-table-2');
				*/
				
				
				//oTable1.fnAdjustColumnSizing();
			
			
				$(document).on('click', 'th input:checkbox' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					//var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			
			})
		</script>

</block>